#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QFile>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QFile file(":/abcefg.qss");
    pApp = (QApplication*)QApplication::instance();//得到应用程序的实例
    file.open(QIODevice::ReadOnly);
    pApp->setStyleSheet(file.readAll());//把样式表设置给应用程序的实例
    file.close();

}

MainWindow::~MainWindow()
{
    delete ui;
}

